#include <bits/stdc++.h>
using namespace std;
string a[100];
int main(){
	string s;
	getline(cin, s);
	int c = 1;
	for (int i = 0; i < s.size(); i++){
		if(s[i] == ','){
			c++;
			continue;
		}
		a[c] = a[c] + s[i];
	}
	for (int i = 1; i <= c; i++){
		int cnta = 0, cntA = 0, cnt1 = 0, cnt = 0;
		for (int j = 0; j < a[i].size(); j++){
			if (a[i][j] >= 'a' && a[i][j] <= 'z') cnta++;
			else if (a[i][j] >= 'A' && a[i][j] <= 'Z') cntA++;
			else if (a[i][j] >= '0' && a[i][j] <= '9') cnt1++;
			else if (a[i][j] == '!' || a[i][j] == '@' || a[i][j] == '#' || a[i][j] == '$') cnt++;
		}
		if (((cnta != 0 && cntA != 0) || (cnta != 0 && cnt1 != 0) || (cntA != 0 && cnt1 != 0)) && cnt != 0 && a[i].size() >= 6 && a[i].size() <= 12 && cnta + cntA + cnt1 + cnt == a[i].size()){
			cout << a[i] << endl;
		}
	}
	return 0;
}